<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8" />
    <base th:href="${#httpServletRequest.getScheme()+'://'+#httpServletRequest.getServerName()+':'+#httpServletRequest.getServerPort()+''+#httpServletRequest.getContextPath()+'/'}" href="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <!-- QQ强制竖屏 -->
    <meta name="x5-orientation" content="portrait" />
    <!-- QQ设置全屏 -->
    <meta name="x5-fullscreen" content="true" />
    <!-- uc强制竖屏 -->
    <meta name="screen-orientation" content="portrait" />
    <!-- uc设置全屏 -->
    <meta name="full-screen" content="yes" />
    <!-- 禁止识别电话号码和邮件号码 -->
    <meta name="format-detection" content="telephone=no,email=no"/>
    <title>爱智付-APP下载</title>
    <script type="text/javascript" th:src="@{reg/js/header.js}" src="js/header.js"></script>
    <link rel="stylesheet" th:href="@{reg/css/style.css}" href="css/style.css" />
</head>

<body class="download">
    <div class="cover wrap tc"><span class="middle"></span><div class="vm inline">
            <img th:src="@{reg/img/logo.png}" src="img/logo.png" alt="" class="img-logo" />
            <a href="javascript:;" class="btn-download" id="js-btn-download">点击下载</a>
        </div>
        <!-- 弹窗提示 -->
        <div class="pop-area cover js-pop-area hide" id="js-pop-guide">
            <div class="cover mask-layer"></div>
            <img th:src="@{reg/img/browse_guide.png}" src="img/browse_guide.png" alt="浏览提示" class="img-guide" />
        </div>
    </div>
    <script>
        var js_btn_download = document.getElementById('js-btn-download'), // 点击下载按钮
            js_pop_guide = document.getElementById('js-pop-guide'); // 弹窗提示

        // 浏览器检测
        function checkBrowser() {
            if(browser.versions.weiXin){
                js_pop_guide.className = "pop-area cover js-pop-area";
            } else{
                var download_url = "upload/izf.apk";
                window.location.href = download_url;
            }
        }

        var browser = {
            versions: function() {
                var u = navigator.userAgent,
                    app = navigator.appVersion;
                return {
                    trident: u.indexOf('Trident') > -1, //IE内核
                    presto: u.indexOf('Presto') > -1, //opera内核
                    webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
                    gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
                    mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/), //是否为移动终端
                    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
                    iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
                    iPad: u.indexOf('iPad') > -1, //是否iPad
                    webApp: u.indexOf('Safari') == -1, //是否web应用程序，没有头部与底部
                    QQbrw: u.indexOf('MQQBrowser') > -1, //是否是QQ浏览器
                    weiXin: u.indexOf('MicroMessenger') > -1, //是否是微信浏览器
                    qq: u.match(/\sQQ/i) == " qq", //是否QQ
                    ucLowEnd: u.indexOf('UCWEB7.') > -1,
                    ucSpecial: u.indexOf('rv:1.2.3.4') > -1,
                    ucweb: function() {
                        try {
                            return parseFloat(u.match(/ucweb\d+\.\d+/gi).toString().match(/\d+\.\d+/).toString()) >= 8.2
                        } catch (e) {
                            if (u.indexOf('UC') > -1) {
                                return true;
                            } else {
                                return false;
                            }
                        }
                    }(),
                    Symbian: u.indexOf('Symbian') > -1, //是否是塞班系统
                    ucSB: u.indexOf('Firefox/1.') > -1
                };
            }()
        }

        // 点击下载按钮
        js_btn_download.ontouchstart = function() {
            this.className = "btn-download active";
        }

        js_btn_download.ontouchend = function() {
            this.className = "btn-download";
            checkBrowser();
        }

        // 点击蒙层
        js_pop_guide.ontouchstart = function() {

        }

        js_pop_guide.ontouchend = function() {
            this.className = "pop-area cover js-pop-area hide";
        }
    </script>
</body>

</html>